package com.qtt.app.mapper;

import com.qtt.app.entity.Test.MsgBoard;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository   //需要写
public interface MsgBoardMapper {
    int deleteByPrimaryKey(Long id);

    int insert(MsgBoard record);

    int insertSelective(MsgBoard record);

    MsgBoard selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(MsgBoard record);

    int updateByPrimaryKeyWithBLOBs(MsgBoard record);

    int updateByPrimaryKey(MsgBoard record);

    //    @Select("SELECT * FROM msg_board")
    List<MsgBoard> list();

    //    @Insert("INSERT INTO msg_board(author,msg,gmt_create) VALUES(#{author},#{msg},#{gmtCreate})")
    Boolean save(MsgBoard entity);

    //    @Delete("DELETE FROM msg_board WHERE id = #{id}“)
    Boolean delete(@Param("id") long id);//一定要记得写@Param，不然xml里面识别不了。
    // 不管是路径传值还是参数传值，都要这么写。多个参数则用逗号隔开。比如Boolean delete(@Param("id") long id,@Param("msg") String msg);

    //    @Update("UPDATE msg_board SET msg = #{msg} WHERE id = #{id}")
    Boolean update(@Param("id") long id,@Param("msg") String msg);
}